﻿from django.template import Library

register = Library()

def active(request, pattern):
    """
    Hightlight current menu item
    """
    import re
    if re.search(pattern, request.path):
        return 'active'
    return ''
    
menu_active = register.simple_tag(active)